package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        Integer value = map.put("语文",66);
        System.out.println(value);
        map.put("语文",60);
        map.put("数学",30);
        map.put("英语",99);
        map.put("物理",99);
        map.put("化学",98);
        System.out.println(map);

        value = map.put("数学",1);
        System.out.println(value);


        value = map.get("数学");
        System.out.println("数学"+value);
        value = map.get("体育");
        System.out.println("体育"+value);


        value = map.remove("数学");
        System.out.println(map);
        System.out.println(value);

        int size = map.size();
        System.out.println("size:"+size);

        boolean ck = map.containsKey("物理");
        System.out.println(ck);
        boolean cv = map.containsValue(60);
        System.out.println(cv);

        map.clear();
        System.out.println(map);
    }
}
